Format of query for getting extensions

In the REST API documentation for listing extensions, one of the supported parameters is “query” but there is no example of how to use it. I’m trying to get a list of the extensions that are associated with a specific service and currently the only way that I can see to do it is to get all the extensions and loop over them looking for one that has an extension_object that is a service_reference to the service that I am looking for. Is there a better way to do this?

Hi Stephen,

Thanks for eaching out about this. The “Query” parameter can be used to filter based on extension name. So, for example, /extensions?query=test will show extensions with “test” in their name.

There currently isn’t a way to filter the results for extensions based on service ID, so I believe you method is currently the best/most efficient.

Josef

1 Like

Hi Stephen,

The extension_object_id parameter is what can be used to filter the extensions index to those of a given service (provided its ID).

https://developer.pagerduty.com/api-reference/reference/REST/openapiv3.json/paths/~1extensions/get